package com.night.administration.controller;

import com.night.administration.service.ClassService;
import com.night.administration.service.StructureService;
import com.night.common.entity.ResultVo;
import com.night.common.entity.administration.Classes;
import com.night.common.entity.administration.Structure;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName: TeacherController
 * @Description: //TODO
 * @author: LZJ
 * @date: 2022/10/23-14:15
 * @version: v1.0
 */
@RestController
@RequestMapping("/api/v1/class")
public class ClassController {
    @Resource
    private ClassService classService;

    @PostMapping("/list")
    public ResultVo<Classes> getAllByCondition() {
        return new ResultVo(classService.getAll());
    }

    @PostMapping("/add")
    public ResultVo<String> add(@RequestBody Classes classes) {
        classService.insert(classes);
        return ResultVo.SUCCESS;
    }

    @PostMapping("/update")
    public ResultVo<String> update(@RequestBody Classes classes) {
//        classService.update(structure);
        return ResultVo.SUCCESS;
    }

}
